package com.slz3.business.module.orderManagement.ordOrder.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.orderManagement.ordOrder.domain.OrdOrder;
import com.slz3.business.module.orderManagement.ordOrder.domain.OrdOrderCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdOrderResAtomic {

    static Mono<ServerResponse> add_$OrdOrderUpdateLock(ServerRequest req, OrdOrder ordOrder) {
        return OrdOrderResSafeValid.add(req, ordOrder) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.add(req, ordOrder);
    }

    public static Mono<ServerResponse> delete_$OrdOrderUpdateLock(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        return OrdOrderResSafeValid.delete(req, ordOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$OrdOrderUpdateLock(ServerRequest req, OrdOrder ordOrder) {
        return OrdOrderResSafeValid.modify(req, ordOrder) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.modify(req, ordOrder);
    }

    static Mono<ServerResponse> info_$OrdOrderUpdateLock(ServerRequest req) {
        return OrdOrderResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$OrdOrderUpdateLock(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        return OrdOrderResSafeValid.auditSubmit(req, ordOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$OrdOrderUpdateLock(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        return OrdOrderResSafeValid.audit(req, ordOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$OrdOrderUpdateLock(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        return OrdOrderResSafeValid.auditReject(req, ordOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$OrdOrderUpdateLock(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        return OrdOrderResSafeValid.usingEnable(req, ordOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$OrdOrderUpdateLock(ServerRequest req, OrdOrderCondition ordOrderCondition) {
        return OrdOrderResSafeValid.usingDisable(req, ordOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                OrdOrderResExecutor.usingDisable(req);
    }
}
